﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/2/18 星期一 23:56:53
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Sector7.Framework.Core
{
    /// <summary>
    /// 实体类变化量基类
    /// </summary>
    [Serializable()]
    [DataContract]
    public class EntityDeltaBase
    {
        #region Inner members
        #endregion

        #region Accessor
        /// <summary>
        /// 获取或设置实体类名
        /// </summary>
        [DataMember]
        public string EntityName { get; set; }

        /// <summary>
        /// 获取或设置制约条件
        /// </summary>
        [DataMember]
        public Dictionary<string, object> Conditions { get; set; }

        /// <summary>
        /// 获取或设置变化的属性
        /// </summary>
        [DataMember]
        public Dictionary<string, object> DeltaProperties { get; set; }
        #endregion

        #region Structure

        public EntityDeltaBase()
        {
        }

        public EntityDeltaBase(Type entityType)
        {
            EntityName = entityType.Name;
            Conditions = new Dictionary<string, object>();
            DeltaProperties = new Dictionary<string, object>();
        }

        #endregion
    }
}
